window._LOCALJF = {
	
	_pre:'nlxy-JF',
	
	_randompre:'nlxy_random',
	
	getJIFEN:function(){
		if(cc.sys.localStorage.getItem(_LOCALJF._pre)){
			return cc.sys.localStorage.getItem(_LOCALJF._pre);
		}else{
			return 0;
		}
	},
	
	addJIFEN:function(nmb){
		var oldjf = cc.sys.localStorage.getItem(_LOCALJF._pre)/1;
		cc.sys.localStorage.setItem(_LOCALJF._pre,oldjf+nmb);
	},
	
	cutJIFEN:function(nmb){
		var oldjf = cc.sys.localStorage.getItem(_LOCALJF._pre)/1;
		if(oldjf<nmb){
			return false;
		}
		var newjf = oldjf-nmb;
		if(newjf<0)
			newjf=0;
		cc.sys.localStorage.setItem(_LOCALJF._pre,newjf);
		return true;
	},
	
	//随机次数相关
	getRandom:function(){
		if(cc.sys.localStorage.getItem(_LOCALJF._randompre)){
			return cc.sys.localStorage.getItem(_LOCALJF._randompre);
		}else{
			return 0;
		}
	},
	
	addRandom:function(nmb){
		var oldjf = cc.sys.localStorage.getItem(_LOCALJF._randompre)/1;
		cc.sys.localStorage.setItem(_LOCALJF._randompre,oldjf+nmb);
	},
	
	cutRandom:function(nmb){
		var oldjf = cc.sys.localStorage.getItem(_LOCALJF._randompre)/1;
		if(oldjf<nmb){
			return false;
		}
		var newjf = oldjf-nmb;
		if(newjf<0)
			newjf=0;
		cc.sys.localStorage.setItem(_LOCALJF._randompre,newjf);
		return true;
	},
	
}